﻿<!--
/*
 * Auto Currency Converter
 * -------------------------------------------------------------------
 * Licensed under the GPLv3 license, see LICENSE in root for details.
 *
 * options.html
 *
 * Copyright (c) 2010 Thomas Klein
 */
-->
﻿<html>
<script type="text/javascript" src="common.js"></script>
<script>
	function save()
	{
		var select = document.getElementById("currency");
		var currency = select.children[select.selectedIndex].value;
		localStorage["currency"] = currency;
		fetchConversionRates();
		window.close();
	}
	
	function restore_options()
	{
		var currency = localStorage["currency"];
		if (!currency)
			return;

		var select = document.getElementById("currency");
		for (var i = 0; i < select.children.length; i++)
		{
			var child = select.children[i];
			if (child.value == currency)
			{
				child.selected = "true";
				break;
			}
		}
	}
</script>
<body onload="restore_options()">
	<h1>Options</h1>
	<form>
		<p>My native currency is: </p>
    <select id="currency">
			<option value="eur">Euro [€]</option>
			<option value="gbp">British Pound Sterling [£]</option>
			<option value="usd">US Dollar [$]</option>
			<option value="cad">Canadian Dollar [$]</option>
			<option value="jpy">Japanese Yen [¥]</option>
    </select>
		<input type="button" value="Save" onclick="save()">
	</form>
</body>
</html>
